<?php
	

defined('_JEXEC') or die();

class NBEventMapsControllerPersonnalisation extends NBEventMapsController
{
	
	function __construct()
	{
		parent::__construct();

	}

	
	function edit()
	{
		JRequest::setVar( 'view', 'personnalisation' );
		JRequest::setVar( 'layout', 'form'  );

		parent::display();
	}

	
	function apply()
	{
		$post	= JRequest::get('post');
		$model = $this->getModel('personnalisation');
		$returnid=$model->store($post);
		if ($returnid>0) {
			$msg = JText::_( 'NBEVENTMAP_SAVED' );
		} else {
			$msg = JText::_( 'NBEVENTMAP_SAVED_ERROR' );
		}

		$link = 'index.php?option=com_nbeventmap&controller=personnalisation&task=edit';
		
		$this->setRedirect($link, $msg);
	}

	
	function remove()
	{
		$model = $this->getModel('personnalisation');
		if(!$model->delete()) {
			$msg = JText::_( 'Error: One or more NBEventMaps could not be Deleted' );
		} else {
			$msg = JText::_( 'NBEventMap(s) Deleted' );
		}

		$this->setRedirect( 'index.php?option=com_nbeventmap&controller=personnalisation&task=edit', $msg );
	}
	
	
	function cancel()
	{
		$msg = JText::_( 'Operation Cancelled' );
		$this->setRedirect( 'index.php?option=com_nbeventmap&controller=personnalisation&task=edit', $msg );
	}

}
?>
